﻿<UserControl
    x:Class="Unread.App.Views.HeaderUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Unread.App.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="140"
    d:DesignWidth="1024">

    <!-- Back button and page title -->
    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Button x:Name="backButton" Command="{Binding GoBack}" IsEnabled="{Binding CanGoBack}" Style="{StaticResource BackButtonStyle}" Margin="36,0,0,36" />
        
        <Grid Grid.Column="1" VerticalAlignment="Bottom">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <ProgressBar Grid.Row="0" IsIndeterminate="True" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
                         Visibility="{Binding IsLoading, Converter={StaticResource booleanToVisibilityConverter}}" />
            
            <StackPanel Grid.Row="1" Orientation="Horizontal">
                <Image Source="ms-appx:///Assets/Logo.png" Height="40" VerticalAlignment="Top" Margin="0,0,20,0" />
                <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}"/>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
